<?php

use Illuminate\Support\Facades\Route;
use App\State\Context;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//状态模式
//Route::get('/', function () {
////    return view('welcome');
//    //创建context 对象
//    $context = new Context();
//    //将当前状态设置为 PublishState
//    $context->setState(new \App\State\PublishState());
//    $context->getCurrentState();
//    $context->acceptOrderEvent($context);
//
//    $context->orderFailureEvent($context);
//   // $context->checkFailEvent($context);
//});


//类适配器
//Route::get('/', function () {
//    $phone = new \App\Adapter\Phone();
//    $phone->charging(new \App\Adapter\VoltageAdapter());
//});
//接口适配器
//Route::get('/', function () {
//    $AbsAdapter = new \App\Adapter\interfaceadapter\AbsAdapter();
//    $AbsAdapter->m1();
//});

//Route::get('/', function () {
//    $phone = new \App\Adapter\Phone();
//    $phone->charging(new \App\Adapter\VoltageAdapter(new \App\Adapter\Voltage220V()));
//});

Route::get('/', function () {
   new \App\Factory\absfactory\OrderPizza(new \App\Factory\absfactory\LDFactory());


});